#pragma once

// represents an ammount of time
class Time
{
	// the ammount of system ticks in the timespan
	unsigned long long tick = 0;

	// the ammount of milliseconds in one system tick
	static const float timeToOneTick;

	Time(unsigned long long ticks);
public:
	Time(void) = default;
	/////////////////////<accessors>//////////////////////////////////////////

	// get the number of milliseconds in this timespan
	float getMilliseconds(void) const { return tick * timeToOneTick; }

	// get the number of seconds in this timespan
	float getSeconds(void) const { return getMilliseconds() / 1000.f; }

	// get the number of minutes in this timespan
	float getMinutes(void) const { return getSeconds() / 60.f; }

	// get the number of hours in this timespan
	float getHours(void) const { return getMinutes() / 60.f; }

	// get the number of days in this timespan
	float getDays(void) { return getHours() / 24.f; }

	/////////////////////<Creation functions>//////////////////////////////////////////

	// creates a time span from milliseconds
	static Time fromMilliseconds(float);

	// creates a time span from seconds
	static Time fromSeconds(float);

	// creates a time span from minutes
	static Time fromMinutes(float);

	// creates a time span from hours
	static Time fromHours(float);

	// creates a time span from days
	static Time fromDays(float);

	/////////////////////<text>//////////////////////////////////////////

	Time operator +(Time&);
	Time operator -(Time&);
};
